<!---
 @Name: index.vue
 @Author: lhf
 @Owner:
 @Date: 2025-07-15 15:20:27
 @LastEditTime: 2025-07-15 15:20:27
 @LastEditors:lhf
 @Description:  医院信息
 @Version:
 @FilePath: src\views\column\index.vue
--->

<template>
  <div class="container">
    <div class="list-wrapper clearfix" v-show="!show">
      <div class="list-body" v-for="(item, index) in lists" @click="toggleInfo(item)" :key="index">
        <span :style="{ backgroundImage: `url(${item.picUrl})` }">{{ item.name || '' }}</span>
      </div>
    </div>
    <bese-column />
  </div>
</template>

<script>
import { getProgramInfo } from '@/api';
export default {
  name: 'HelloWorld',
  props: {
    programId: String
  },
  components: {},
  data() {
    return {
      lists: []
    };
  },
  computed: {
    show() {
      return this.$store.getters.show;
    }
  },
  mounted() {
    this.getProgramInfos();
  },
  methods: {
    toggleInfo(row) {
      const { content = '' } = row || {};
      if (!content || content === '') return;
      this.$store.commit('SET_INFO', content);
      this.$store.commit('SET_SHOW', true);
    },
    getProgramInfos() {
      getProgramInfo({
        programId: this.programId
      }).then((res) => {
        if (res.status == 0) {
          this.lists = res.data || [];
        }
      });
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
.container {
  height: 100%;
  border-radius: 20px;
  line-height: 1.5;
  text-align: justify;
  overflow: hidden;
  word-break: break-word;
  font-size: 28px;
  .list-wrapper {
    height: 100%;
    overflow-y: auto;
    margin: -15px;
    .list-body {
      float: left;
      width: 25%;
      padding: 15px;
      text-align: center;
      span {
        display: flex;
        background-repeat: no-repeat;
        background-position: center;
        background-size: cover;
        color: #fff;
        align-items: center;
        justify-content: center;
        border-radius: 20px;
        font-weight: 500;
        font-size: 48px;
        height: 250px;
        padding: 10px;
        overflow: hidden;
      }
    }
  }
}
</style>
